<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateNationMallLogTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('nation_mall_log', function (Blueprint $table) {
            $table->increments('id');//自增id
            $table->integer('user_id')->comment('用户id');
            $table->tinyInteger('gift_type')->default(7)->comment(' 0 普  1摩托 2 100积分 3 天 4 靓号 5亲密值3点 6庆 7法拉利 8金豆  9同 10积分50 11 亲密值 1 点');
            $table->string('gift_value')->default(0)->comment('获取值 ');
            $table->integer('num_count')->default(0)->comment('获取总数');
            $table->timestamp('created_at')->default(\Illuminate\Support\Facades\DB::raw("CURRENT_TIMESTAMP"))->comment('创建时间');
            $table->index(['user_id']);
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('nation_mall_log');
    }
}
